package cn.jizi.bshisy.controller;

import cn.jizi.bshisy.entity.Examine;
import cn.jizi.bshisy.entity.Prescription;
import cn.jizi.bshisy.service.PrescriptionService;
import cn.jizi.bshisy.tool.ShuiJi;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/prescri")
public class PrescriptionCotroller {
    @Resource
    private PrescriptionService prescriptionService;

    /*添加一条处方表信息*/
    @ApiOperation(value="添加一条处方表信息", notes="添加一条处方表信息")
    @PostMapping(value = "/getAddPrescr")
    public String getAddPayItems(Prescription prescription) {
        prescription.setPid(ShuiJi.random());
        int count=prescriptionService.getAddPrescr(prescription);
        if(count>0){
            return "添加成功";
        }else {
            return "添加失败";
        }
    }

}
